module.exports = {
  description: '创建一个页面',
  prompts: [
    {
      type: 'input',
      name: 'filePath',
      message: '输入文件地址，例如：goods/list,无多级目录直接回车跳过',
    },
    {
      type: 'input',
      name: 'name',
      message: '输入页面路由名称',
      default: 'MyPage',
    },
    {
      type: 'checkbox',
      name: 'codeType',
      message: '选择开发语言,默认:jsx,css',
      choices: ['tsx', 'scss', 'cssModule'],
      default: ['scss', 'cssModule'],
    },
  ],
  actions: [
    {
      type: 'add',
      path: `src/views/{{snakeCase filePath}}/{{pascalCase name}}/index.{{jsType codeType}}`,
      templateFile: `./_plop/templates/view.hbs`,
    },
    {
      type: 'add',
      path: `src/views/{{snakeCase filePath}}/{{pascalCase name}}/index{{cssModule codeType}}.{{cssType codeType}}`,
      templateFile: './_plop/templates/component.css.hbs',
    },
  ],
};
